package com.siyuan.sns.boss.dao.impl;

import org.hibernate.Session;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Repository;

import com.siyuan.sns.boss.dao.BossDao;
import com.siyuan.sns.boss.domain.entity.Boss;
import com.siyuan.sns.utils.dao.BaseDao;

@Repository("bossDao")
public class BossDaoImpl extends BaseDao implements BossDao {

	@Override
	public Boss findByUsername(String username) {
		Session session = this.getSession();
		return (Boss) session.createCriteria(Boss.class)
				.add(Restrictions.eq("username", username)).uniqueResult();
	}

}
